import { p as public_env } from "./shared-server.js";
import "sse.js";
import { c as create_ssr_component, f as add_attribute, v as validate_component, r as createEventDispatcher, e as escape } from "./index2.js";
var MessageRole = /* @__PURE__ */ ((MessageRole2) => {
  MessageRole2[MessageRole2["Assistant"] = 0] = "Assistant";
  MessageRole2[MessageRole2["User"] = 1] = "User";
  return MessageRole2;
})(MessageRole || {});
public_env.CHAT_BASE_URL;
const driver$1 = "";
const driver = "";
const Thumbnail_svelte_svelte_type_style_lang = "";
const Indicator_svelte_svelte_type_style_lang = "";
public_env.UPLOAD_FILE_BASE_URL;
public_env.GET_FILE;
public_env.DELETE_FILE;
const PaperAirplane = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let { overrideClasses = "" } = $$props;
  const classes = overrideClasses ? overrideClasses : `w-5 h-5 text-gray-400`;
  if ($$props.overrideClasses === void 0 && $$bindings.overrideClasses && overrideClasses !== void 0)
    $$bindings.overrideClasses(overrideClasses);
  return `






<svg t="1708926517502"${add_attribute("class", classes, 0)} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4586" id="mx_n_1708926517503" width="200" height="200"><path d="M0 1024l106.496-474.112 588.8-36.864-588.8-39.936-106.496-473.088 1024 512z" p-id="4587" fill="#0068b5"></path></svg>`;
});
const Assistant = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  return `

	`;
});
const PersonOutlined = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  return `



<svg t="1708914168912" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1581" width="200" height="200"><path d="M447.13 46.545h101.818v930.91H447.13V46.545z" fill="#0068b5" p-id="1582" data-spm-anchor-id="a313x.search_index.0.i0.12a13a81x9rPe6" class="selected"></path></svg>`;
});
const MessageAvatar = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let { role } = $$props;
  if ($$props.role === void 0 && $$bindings.role && role !== void 0)
    $$bindings.role(role);
  return `



${role === MessageRole.User ? `${validate_component(PersonOutlined, "PersonOutlined").$$render($$result, {}, {}, {})}` : `${validate_component(Assistant, "AssistantIcon").$$render($$result, {}, {}, {})}`}`;
});
const MessageTimer = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let { time } = $$props;
  createEventDispatcher();
  if ($$props.time === void 0 && $$bindings.time && time !== void 0)
    $$bindings.time(time);
  return `



<div class="ml-2 flex flex-col"><div class="my-4 flex items-center justify-end gap-2 space-x-2"><div class="ml-2 w-min cursor-pointer" data-state="closed">
			<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 21.6 21.6" width="24" height="24" class="w-5 fill-[#0597ff] hover:fill-[#0597ff]"><path d="M2.2 3.6V.8h17.2v2.8zm7.2 17.2V10.4L5.8 14l-1.9-1.9 6.9-6.9 6.9 6.9-1.9 1.9-3.6-3.6v10.4z"></path></svg></div>
		<div class="inline-block w-0.5 self-stretch bg-gray-300 opacity-100 dark:opacity-50"></div>
		<div class="w-min cursor-pointer" data-state="closed"><svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 21.6 21.6" width="24" height="24" class="w-5 fill-[#0597ff] hover:fill-[#0597ff]"><path d="M12.3 17.1V7.6H7.6v2.8h1.9v6.7H6.4v2.7h8.8v-2.7z"></path><circle cx="10.8" cy="3.6" r="1.9"></circle></svg></div>
		<div class="flex items-center space-x-1 text-base text-gray-800" data-testid="msg-time"><strong>End to End Time: </strong>
			<p>${escape(time)}s</p></div></div>
	<div class="ml-2 flex flex-col"></div></div>`;
});
const ChatMessage = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  createEventDispatcher();
  let { msg } = $$props;
  let { time = "" } = $$props;
  if ($$props.msg === void 0 && $$bindings.msg && msg !== void 0)
    $$bindings.msg(msg);
  if ($$props.time === void 0 && $$bindings.time && time !== void 0)
    $$bindings.time(time);
  return `



<div${add_attribute(
    "class",
    msg.role === 0 ? "flex w-full gap-3" : "flex w-full items-center gap-3",
    0
  )}${add_attribute("data-testid", msg.role === 0 ? "display-answer" : "display-question", 0)}><div${add_attribute(
    "class",
    msg.role === 0 ? "flex aspect-square w-[3px]  items-center justify-center rounded bg-[#0597ff] max-sm:hidden" : "flex aspect-square h-10 w-[3px] items-center justify-center rounded bg-[#000] max-sm:hidden",
    0
  )}>${validate_component(MessageAvatar, "MessageAvatar").$$render($$result, { role: msg.role }, {}, {})}</div>
	<div class="group relative items-center"><div><p class="max-w-[60vw] items-center whitespace-pre-line break-keep text-[0.8rem] leading-5 sm:max-w-[60rem]"><!-- HTML_TAG_START -->${msg.content}<!-- HTML_TAG_END --></p></div></div></div>
${time ? `<div>${validate_component(MessageTimer, "MessageTimer").$$render($$result, { time }, {}, {})}</div>` : ``}`;
});
export {
  ChatMessage as C,
  PaperAirplane as P
};
